Skip to content

feat(ui): 增加概览页年度活动热图#716

Open
FFFxueGawaine wants to merge 5 commits into
Open-Less:betafrom
FFFxueGawaine:feat/overview-activity-heatmap
Open

feat(ui): 增加概览页年度活动热图#716
FFFxueGawaine wants to merge 5 commits into
Open-Less:betafrom
FFFxueGawaine:feat/overview-activity-heatmap

Conversation

@FFFxueGawaine

@FFFxueGawaine FFFxueGawaine commented Jun 19, 2026

Copy link
Copy Markdown

User description

摘要

Fixes #。(暂无关联 issue)

本 PR 在「今日概况 / Overview」页面增加年度活动热图,并补充文字历史保留策略配置:用户可以用每日 / 每周 / 累计三种视图查看过去一年的历史记录活跃度,同时默认不再按天数或条数限制文字历史记录。

新增 / 改进

Overview 年度活动热图

  • 新增概览页年度活动热图,支持「每日 / 每周 / 累计」三种视图。
  • 每日、每周、累计都沿用格子化视觉;每周和累计按周离散成 7 个等级展示。
  • 每周 / 累计统计以周一到周日为一周,悬浮提示显示该周的周一日期。
  • 悬浮提示跟随鼠标 / 格子位置显示对应日期、周起始日或累计数据。
  • 切换视图时增加从左到右的快速出现动画。
  • 在「设置 → 通用 → 外观」新增「显示概况活动热图」开关,默认开启。
  • 关闭开关只隐藏概况页年度活动热图,不删除历史记录,也不影响其它概况指标。
  • 移除概况页顶部的一键浅色 / 深色切换入口,主题切换仍保留在外观设置里。

文字历史保留

  • 将文字历史保留天数默认改为无限制。
  • 将文字历史条数上限默认改为无限制。
  • 历史保留设置为空或 0 时,视为无限制。
  • 后端文字历史清理逻辑同步放开,条数无限制时不再回退到旧的 200 条上限。
  • 旧版默认 7 天的配置会自动迁移为无限制;用户手动设置的其他天数不受影响。
  • 本次设置仅影响文字历史记录,不改变本地录音文件的保存策略。

Overview 活动统计

  • 在 Overview 活动摘要中增加时长统计。
  • 时长按 sminh 展示。
  • 非零时长保留 1 位小数,0 时显示为 0s

本地开发与多语言

  • 优化 mock history 分布,让本地开发环境能看到近 7 天柱状图和年度热图效果。
  • 补充 zh-CN / zh-TW / en / ja / ko 文案。

兼容

  • 新增一个默认开启的外观偏好 showOverviewActivityHeatmap
  • 新增历史保留默认迁移标记 historyRetentionDefaultMigrated
  • 生产历史数据读取仍沿用现有 listHistory
  • 不改变本地录音文件保存策略。
  • 不涉及 Provider 凭据持久化、数据库结构、新增 IPC 命令或构建流程变更。

截图

浅色主题

浅色年度活动热图

深色主题

深色年度活动热图

每周 / 累计

每周模式

累计模式

测试计划

  • npm run build
  • cargo check --manifest-path openless-all/app/src-tauri/Cargo.toml
  • cargo test append_with_no_max_entries_keeps_more_than_legacy_cap --target x86_64-pc-windows-msvc
  • 本地概览页预览:每日 / 每周 / 累计切换可用;外观设置开关可隐藏概况页年度热图。

最新提交

  • 7681d92205f9110d7f1de8ce778e5d6732f64d7c

PR Type

Enhancement, Tests


Description

  • Add annual activity heatmap to Overview page with daily/weekly/cumulative views

  • Uncap history retention and max entries defaults to unlimited

  • Add toggle for heatmap under Settings > Appearance

  • Update duration formatting and i18n keys for all locales


File Walkthrough

Relevant files
Enhancement
8 files
history.rs
Allow unlimited history count cap                                               
+55/-10 
preferences.rs
Migrate legacy history retention default                                 
+56/-6   
types.rs
Add history retention migration flag and heatmap pref       
+29/-5   
types.ts
Update history retention comments and add fields                 
+4/-2     
Overview.tsx
Implement annual activity heatmap component                           
+700/-30
DataStorageSection.tsx
Remove hard cap limits, add unlimited placeholder               
+10/-12 
ThemeSection.tsx
Add heatmap toggle UI                                                                       
+14/-1   
global.css
Add activity cell-in animation keyframe                                   
+5/-0     
Documentation
5 files
en.ts
Add heatmap and unlimited i18n keys                                           
+24/-4   
ja.ts
Add heatmap and unlimited i18n keys                                           
+25/-5   
ko.ts
Add heatmap and unlimited i18n keys                                           
+25/-5   
zh-CN.ts
Add heatmap and unlimited i18n keys                                           
+25/-5   
zh-TW.ts
Add heatmap and unlimited i18n keys                                           
+25/-5   
Tests
2 files
mock-data.ts
Update mock history for yearly activity                                   
+37/-18 
stylePrefs.test.ts
Update test prefs to match new defaults                                   
+3/-1     

@github-actions

github-actions Bot commented Jun 19, 2026

Copy link
Copy Markdown
Contributor

PR Reviewer Guide 🔍

(Review updated until commit 20435df)

Here are some key observations to aid the review process:

⏱️ Estimated effort to review: 3 🔵🔵🔵⚪⚪
🧪 PR contains tests
🔒 No security concerns identified
⚡ No major issues detected

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 15f4adf

@FFFxueGawaine

Copy link
Copy Markdown
Author

UI 截图证据

这些截图已随本 PR 提交到 docs/images/pr-716/,不是本地路径。

浅色主题

浅色年度活动热图

深色主题

深色年度活动热图

每周 / 累计 / 悬浮提示

每周模式

累计模式

悬浮提示

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 55037ed

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 2cb22ce

@H-Chris233

Copy link
Copy Markdown
Collaborator

我们决定合并你的pr,但在此之前请给开关用于开关该功能

jiangmuran
jiangmuran previously approved these changes Jun 21, 2026

@jiangmuran jiangmuran left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

非常好代码,使我免于阅读AI Slop之苦

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 141de63

@FFFxueGawaine

FFFxueGawaine commented Jun 21, 2026

Copy link
Copy Markdown
Author

@jiangmuran 谢谢!确实有 GPT-5 帮忙,但我尽量把 diff 控制得小一点、方便 review。

维护者要求的「显示概况活动热图」开关和设置页截图也已经补上了;方便的话麻烦再帮忙 review 一下。来自Codex的回复。

@FFFxueGawaine

Copy link
Copy Markdown
Author

Added the Settings toggle screenshot as well:

Settings toggle

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 1fed45a

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 4588a23

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 1fed45a

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 7681d92

@FFFxueGawaine

Copy link
Copy Markdown
Author

本次补充更新说明

对应最新提交:7681d92205f9110d7f1de8ce778e5d6732f64d7c

文字历史保留

  • 将文字历史保留天数默认改为无限制。
  • 将文字历史条数上限默认改为无限制。
  • 历史保留设置为空或 0 时,视为无限制。
  • 后端文字历史清理逻辑同步放开,条数无限制时不再回退到旧的 200 条上限。
  • 旧版默认 7 天的配置会自动迁移为无限制;用户手动设置的其他天数不受影响。
  • 本次设置仅影响文字历史记录,不改变本地录音文件的保存策略。

Overview 活动统计

  • 在 Overview 活动摘要中增加时长统计。
  • 时长按 sminh 展示。
  • 非零时长保留 1 位小数,0 时显示为 0s

验证

  • npm run build
  • cargo test append_with_no_max_entries_keeps_more_than_legacy_cap --target x86_64-pc-windows-msvc

@appergb appergb left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Blocking before merge: this PR is currently CONFLICTING and only PR-Agent has run. It also includes the same retention/cap behavior change as the later sharing PR: history can become unlimited by default, which is a privacy/storage/performance decision and should not be bundled into the heatmap UI without an explicit product decision and full CI.

@github-actions

Copy link
Copy Markdown
Contributor

Persistent review updated to latest commit 20435df

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants